package com.example.idachuappone.index.welcomentity;

import org.json.JSONObject;

public class ShareContent {
	private String content;
	private String img;
	private String title;
	private String url;

	public ShareContent parseJson(JSONObject json) {
		if (json == null) {
			return null;
		}
		if (json.has("url")) {
			this.url = json.optString("url");
		}
		if (json.has("title")) {
			this.title = json.optString("title");
		}
		if (json.has("content")) {
			this.content = json.optString("content");
		}
		if (!json.has("img")) {
			return this;
		}
		this.img = json.optString("img");
		return this;
	}

	public ShareContent(String url, String title, String content, String img) {
		this.url = url;
		this.title = title;
		this.content = content;
		this.img = img;
	}

	/**
	 * 
	 */
	public ShareContent() {
		// TODO Auto-generated constructor stub
	}

	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getImg() {
		return this.img;
	}

	public void setImg(String img) {
		this.img = img;
	}
}
